package de.urlaub.server.data;

import java.io.Serializable;

import javax.interceptor.Interceptors;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import de.urlaub.server.logging.LoggingInterceptor;

@Entity
@Table(name="VacationEntitlement")
@Interceptors(LoggingInterceptor.class)
public class VacationEntitlement implements Serializable {
	
	private static final long serialVersionUID = -4179511897786188730L;
	@Id
	@ManyToOne(cascade = CascadeType.ALL)
	@JoinColumn(name = "employeeId")
	private Employee employeeId;
	@Id
	@Column(nullable=false)
	private int year;
	@Column(nullable=false)
	private int leaveEntitlement;
	@Column(nullable=false)
	private int residualLeave;
	
	public Employee getEmployee() {
		return employeeId;
	}
	public void setEmployee(Employee employee) {
		this.employeeId = employee;
	}
	
	public int getYear() {
		return year;
	}
	public void setYear(int year) {
		this.year = year;
	}
	public int getLeaveEntitlement() {
		return leaveEntitlement;
	}
	public void setLeaveEntitlement(int leaveEntitlement) {
		this.leaveEntitlement = leaveEntitlement;
	}
	public int getResidualLeave() {
		return residualLeave;
	}
	public void setResidualLeave(int residualLeave) {
		this.residualLeave = residualLeave;
	}
	
	
	
}
